﻿
@{
    ViewData["Title"] = "Home";
}
@section Head{
    <link href="~/assets/libs/Bootstrap-Table/bootstrap-table.min.css" rel="stylesheet" />
}
@section Foot{
    <script src="~/assets/libs/Bootstrap-Table/bootstrap-table.min.js"></script>
    <script>
        var vm = new Vue({
            el: '#form',
            data: {
            },
            methods: {
                formatDetail: function (value, row, index) {
                    return "<span onclick='vm.detail(\"" + row.Code + "\")' class='glyphicon glyphicon-list' aria-hidden='true'></span>";
                },
                detail: function (code) {
                    window.location.href = "/servicesmanager/service?server=" + code;
                },
                responseHandler: function (resp) {
                    return resp;
                }
            }
        });
    </script>
}
<div class="container" id="form">
    <h4>Server</h4>

    <table id="table" data-toggle="table"
           data-search="true"
           data-show-refresh="true"
           data-url="/servicesmanager/getaddresses"
           data-response-handler="vm.responseHandler">
        <thead>
            <tr>
                <th data-field="Code">Address</th>
                <th data-field="IsHealth">Health Status</th>
                <th data-filed="_detail" data-formatter="vm.formatDetail"></th>
            </tr>
        </thead>
    </table>
</div>